package com.kly.smartbi.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kly.smartbi.model.dto.questionsubmit.QuestionSubmitAddRequest;
import com.kly.smartbi.model.dto.questionsubmit.QuestionSubmitQueryRequest;
import com.kly.smartbi.model.entity.QuestionSubmit;
import com.kly.smartbi.model.vo.QuestionSubmitVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author admin
* @description 针对表【question(题目表)】的数据库操作Service
* @createDate 2025-04-15 16:38:03
*/
public interface QuestionSubmitService extends IService<QuestionSubmit> {

    /**
     * 校验
     *
     * @param questionSubmit
     * @param add
     */
    void validQuestionSubmit(QuestionSubmit questionSubmit, boolean add);

    /**
     * 获取查询条件
     *
     * @param questionSubmitQueryRequest
     * @return
     */
    QueryWrapper<QuestionSubmit> getQueryWrapper(QuestionSubmitQueryRequest questionSubmitQueryRequest);

    /**
     * 从 ES 查询
     *
     * @param questionSubmitQueryRequest
     * @return
     */
    Page<QuestionSubmit> searchFromEs(QuestionSubmitQueryRequest questionSubmitQueryRequest);

    /**
     * 获取帖子封装
     *
     * @param questionSubmit
     * @param request
     * @return
     */
    QuestionSubmitVO getQuestionSubmitVO(QuestionSubmit questionSubmit, HttpServletRequest request);

    /**
     * 分页获取帖子封装
     *
     * @param questionSubmitPage
     * @param request
     * @return
     */
    Page<QuestionSubmitVO> getQuestionSubmitVOPage(Page<QuestionSubmit> questionSubmitPage, HttpServletRequest request);

    /**
     * 添加题目
     * @param questionSubmitAddRequest
     * @return
     */
    Long addQuestionSubmit(QuestionSubmitAddRequest questionSubmitAddRequest);
}
